package com.sumainfor.pc.market.service;

import com.sumainfor.common.util.ContextUtils;
import com.sumainfor.common.util.JsonResult;
import com.sumainfor.common.utlis.ParamsCommon;
import com.sumainfor.pc.market.dao.RdProfitMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
import java.util.concurrent.locks.ReentrantLock;

/**
 *运营部分配服务管家
 */
@Service
public class RdProfitService implements Serializable {

    private ReentrantLock lock = new ReentrantLock(false);

    Logger log = LoggerFactory.getLogger(RdProfitService.class);// 日志

    @Autowired
    private RdProfitMapper rdProfitMapper;

    /**
     *查询楼号
     */
    public JsonResult getCommunityBuilDing(Map<String,Object> params){
        JsonResult result=new JsonResult();
        if (params.get("ComId")==null){
            return  result.putFailed("参数不正确");
        }
        List<Map<String,Object>> list=rdProfitMapper.getCommunityBuilDing(params);
        if (list!=null){
            result.put(list);
        }else{
            result.putFailed("服务器繁忙");
        }
        return  result;
    }
    /**
     *查询室号
     */
    public JsonResult getCommunityRoom(Map<String,Object> params){
        JsonResult result=new JsonResult();
        if (params.get("ComId")==null || params.get("BuilDing")==null){
            return  result.putFailed("参数不正确");
        }
        List<Map<String,Object>> list=rdProfitMapper.getCommunityRoom(params);
        if (list!=null){
            result.put(list);
        }else{
            result.putFailed("服务器繁忙");
        }
        return  result;
    }
}
